<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@include file="../../mytags.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <t:base type="jquery"></t:base>
    <script type="text/javascript" src="webpage/com/wx/added_product/procurement/shoppingCar.js"></script>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>零件采购</title>
    <script type="text/javascript" charset="utf-8">
        mui.init();
    </script>
    <style>
        #detailTable{
            width: 100%;
            padding-left: 15px;
            /* font-size: 14px; */
            font-size: 14px;
            color: #a6aaab;
            font-weight: normal
        }
        #detailTable td{
            padding:5px 5px 5px 10px;
        }
        #detailTable td:nth-child(even){
            color:black;
            text-align: left;
            font-size:1em;
        }

        #detailTable td:nth-child(odd){
            text-align: right;
            font-size:1em;
        }
        .inr>h3{
            padding-left:15px;
        }
    </style>
</head>
<body>

<div class="mui-content" style="margin-bottom: 100px;">
    <div class="xq" style="height:206px;background-color:white ">
        <div class="mui-slider">
            <div class="mui-slider-group">
                <c:if test="${not empty partInfo.partImgList }">
                    <c:forEach var="img" items="${partInfo.partImgList}">
                        <div class="mui-slider-item" style="text-align: center">
                            <a class="" href="#" target="_blank">
                                <img src="cbsPartInfoController.do?downLoadFile&filePath=${img.allPath }" style="width: 200px;height: 200px;">
                            </a>
                        </div>
                        <%--<div class="mui-slider-item"><a href="#">
                            <img
                                 src="cbsPartInfoController.do?downLoadFile&filePath=${img.allPath }"/>
                        </a>
                        </div>--%>

                    </c:forEach>
                </c:if>
                <c:if test="${empty partInfo.partImgList}">
                    <div class="mui-slider-item" style="text-align: center">
                        <a class="" href="#" target="_blank">
                            <img src="cbsPartInfoController.do?downLoadFile&filePath=${partInfo.filePath }" style="width: 200px;height: 200px;">
                        </a>
                    </div>
                    <%--<div class="mui-slider-item"><a href="#">
                        <img src="cbsPartInfoController.do?downLoadFile&filePath=${partInfo.filePath }"/>
                    </a>
                    </div>--%>
                </c:if>
            </div>
        </div>


    </div>
    <div class="mui-card"
         style="margin: 0; box-shadow: none; background: none;">
        <ul class="mui-table-view hn">
            <li style="margin-top: -1px;">
                <div class="mui-input-row mui-checkbox mui-left li_f mui-clearfix">
                    <div class="inr" style="margin-left: 0px;">
                        <h3>
                            <img src="${webRoot}images/about.jpg"
                                 style="max-width: 5px; margin-right: 10px; vertical-align: bottom;">产品详情
                        </h3>
                        <div class="inrr" style="padding-bottom: 10px;">
                            <table id="detailTable">
                                <tr>
                                    <td width="80px">商品名称</td>
                                    <td >${partInfo.wechatName }</td>
                                </tr>
                                <tr>
                                    <td >备件号</td>
                                    <td >${partInfo.partNo }</td>
                                </tr>
                                <tr>
                                    <td >规格</td>
                                    <td >${partInfo.type }</td>
                                </tr>
                                <tr>
                                    <td >价格</td>
                                    <td class="price-group">
                                        <span>¥<fmt:formatNumber value="${partInfo.wechatPrice }" pattern="#,###.00"/></span><br/>
                                        <span>¥<fmt:formatNumber value="${partInfo.terminalPrice }" pattern="#,###.00"/></span>
                                    </td>
                                </tr>
                                <c:if test="${from!='normal'}">
                                <tr>
                                    <td >数量</td>
                                    <td class="price-group">
                                        <span class="mui-numbox" data-numbox-min='1'
                                              style="padding: 0 25px; width: 80px; height: 25px; color: #333;margin-left:0px;float:left">
                                            <button class="mui-btn-numbox-minus" type="button"
                                                    style="width: 25px;">-</button> <input
                                                            class="mui-input-numbox" type="number" style="font-size: 12px;" value="1" id="proNum"/>
                                            <button class="mui-btn-numbox-plus" type="button"
                                                    style="width: 25px;">+</button>
                                        </span>
                                    </td>
                                </tr>
                                </c:if>
                                <tr>
                                    <td width="20%" valign="top">快递</td>
                                    <td width="80%">免运费</td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </li>
        </ul>
    </div>
    <div class="mui-card"
         style="margin: 0; box-shadow: none; background: none;">
        <ul class="mui-table-view hn">
            <li>
                <div class="mui-input-row mui-checkbox mui-left li_f mui-clearfix">
                    <div class="inr" style="margin-left: 0px;">
                        <h3>
                            <img src="${webRoot}images/about.jpg"
                                 style="max-width: 5px; margin-right: 10px; vertical-align: bottom;">特别备注
                        </h3>
                        <div class="inrr" style="padding: 5px 5px;">
                            ${partInfo.details }
                        </div>
                    </div>
                </div>
            </li>
        </ul>
    </div>
    <c:if test="${from!='normal'}">
        <div class="detail-footer " style="position:fixed">
           <div onclick="addShoppingCar('${partInfo.id}')">
               加入购物车
           </div>
            <div onclick="addShoppingCar('${partInfo.id}',true)">
                立即购买
            </div>
        </div>
    </c:if>
</div>

<script type="text/javascript">

    function addShoppingCar(id, buyNow) {
        var count =  $("#proNum").val();
        if (count > 0) {
            _Car.addItem({
                id: id,
                num: count
            }, function () {
                if (buyNow) {
                    _Car.openSimpleWindow(_Car.link.settle);
                }
                _Car.msg.addToCarSuc();
            })
        }
    }

</script>
</body>
</html>